home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / AllegroCL11 / Library / Traps.lisp < prev   
Encoding:
Text File  |  1987-10-27  |  38.8 KB  |  1,097 lines  |  [TEXT/CCL ]

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;Trap.Lisp
  3. ;;
  4. ;;Copyright 1986, 1987 Coral Software Corp.
  5. ;;
  6. ;;
  7. ;;   This file contains trap definitions for most Macintosh traps provided
  8. ;;   by the Macintosh Plus, and some additional traps from later Macintoshes
  9. ;;   (e.g. color Quickdraw traps).
  10. ;;
  11. ;;  Additional trap definitions can be added easily.  All you need is the trap
  12. ;;  number, from Inside Macintosh.
  13. ;;
  14. ;;  To access traps from Allegro CL, load this file.  The traps can then be
  15. ;;  called using the format described in chapter 12 of the Allegro CL User's
  16. ;;  Guide.
  17. ;;
  18. ;;  Note that traps are defined as macros, so this file must be loaded before
  19. ;;  compiling functions which use the traps.
  20. ;;
  21. ;;  If memory is short, you may want to comment-out unused traps.
  22. ;;  Loading this entire file will use of about 60K of memory.
  23. ;;
  24. ;;
  25.  
  26. ;;
  27. ;;The following mechanism is used to define traps:
  28. ;;
  29. ;;   For each trap _Foo, this file defines a lisp constant _Foo (which has
  30. ;;   as its value the trap number) and a macro _Foo which expands into a call
  31. ;;   to the function STACK-TRAP or the function REGISTER-TRAP.
  32. ;;
  33. ;;   The file contains four functions which generate these constants and macros.
  34. ;;   Each function produces trap calls of a slightly different format (to
  35. ;;   support stack-traps, register-traps, hfs-traps, and package-traps).
  36. ;;
  37. ;;   Each of these functions is mapped over an array of
  38. ;;   trap-names/trap-numbers.
  39. ;;
  40. ;;   To add trap definitions, add trap-name/trap-number pairs to the appropriate
  41. ;;   array definition.  To remove trap definitions, comment-out
  42. ;;   trap-name/trap-number pairs from the array definition.
  43. ;;
  44. ;;
  45.  
  46.  
  47.  
  48. (in-package "CCL")
  49.  
  50.  
  51.  
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. ;;stack-trap-macro-function
  54. ;;
  55. ;;function used for defining stack-traps
  56. ;;
  57. ;;it transforms a call that looks like this
  58. ;;
  59. ;;                              (_Foo [:check-error] . args)
  60. ;;
  61. ;;into one that looks like this
  62. ;;
  63. ;;                              (stack-trap [:check-error] _Foo . args)
  64.  
  65.  
  66. (defun stack-trap-macro-function (call env &aux (name (car call)))
  67.    (declare (ignore env))
  68.    (setq call (cdr call))
  69.    (cons 'stack-trap
  70.       (if (memq (car call) *error-check-keywords*)
  71.           (list* (car call) name (cdr call))
  72.         (cons name call))))
  73.  
  74.  
  75. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  76. ;;register-trap-macro-function
  77. ;;
  78. ;;function used for defining register-traps
  79. ;;
  80. ;;it transforms a call that looks like this
  81. ;;
  82. ;;                              (_Foo [:check-error] . args)
  83. ;;
  84. ;;into one that looks like this
  85. ;;
  86. ;;                              (register-trap [:check-error] _Foo . args)
  87.  
  88.   
  89. (defun register-trap-macro-function (call env &aux (name (car call)))
  90.    (declare (ignore env))
  91.    (setq call (cdr call))
  92.    (cons 'register-trap
  93.       (if (memq (car call) *error-check-keywords*)
  94.           (list* (car call) name (cdr call))
  95.         (cons name call))))
  96.  
  97.  
  98.  
  99. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  100. ;;hfs-trap-macro-function
  101. ;;
  102. ;;function used for defining hfs-traps
  103. ;;
  104. ;;it transforms a call that looks like this
  105. ;;
  106. ;;                (_Foo [:check-error] . args)
  107. ;;
  108. ;;into one that looks like this
  109. ;;
  110. ;;                (register-trap [:check-error] _HFSDispatch :d0 _Foo . args)
  111. ;;
  112.  
  113. (defun hfs-trap-macro-function (call env &aux (name (car call)))
  114.    (declare (ignore env))
  115.    (setq call (cdr call))
  116.    (cons 'register-trap
  117.      (if (memq (car call) *error-check-keywords*)
  118.         (list* (car call) #xA260 :d0 name (cdr call))
  119.        (list* #xA260 :d0 name call))))
  120.  
  121.  
  122.  
  123. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  124. ;;pack-trap-macro-function
  125. ;;
  126. ;;function used for defining package-traps
  127. ;;
  128. ;;it transforms a call that looks like this
  129. ;;
  130. ;;                      (_Foo [:check-error] . args )
  131. ;;
  132. ;;into one that looks like this
  133. ;;
  134. ;;                      (stack-trap [:check-error] _Packn ..args.. :word _Foo)
  135. ;;
  136.  
  137. (defun pack-trap-macro-function (call env
  138.                                       &aux (name (car call))
  139.                                            (pack (get (car call) 'sys-trap-pack)))
  140.    (declare (ignore env))
  141.    (setq call (list-reverse (cdr call)))
  142.    (setq call
  143.      (list-reverse
  144.       (if (and call (assq (car call) *stack-trap-output-keywords*))
  145.          (list* (car call) name :word (cdr call))
  146.         (list* name :word call))))
  147.    (cons 'stack-trap
  148.      (if (memq (car call) *error-check-keywords*)
  149.         (list* (car call) pack (cdr call))
  150.        (cons pack call))))
  151.  
  152.  
  153. ;; ####################################################################
  154. ;; ########################## Stack Traps #############################
  155. ;; ####################################################################
  156.  
  157. (let ((macro-fn #'stack-trap-macro-function)
  158.       (traps '#(
  159.                 ;**************************************************
  160.                 ;Control Manager traps:
  161.  
  162.                 (_DisposControl . #xA955)
  163.                 (_DragControl . #xA967)
  164.                 (_DrawControls . #xA969)
  165.                 (_FindControl . #xA96C)
  166.                 (_Draw1Control . #xA96D)
  167.                 (_GetCRefCon . #xA95A)
  168.                 (_GetCTitle . #xA95E)
  169.                 (_GetCtlAction . #xA96A)
  170.                 (_GetCtlValue . #xA960)
  171.                 (_GetMaxCtl . #xA962)
  172.                 (_GetMinCtl . #xA961)
  173.                 (_GetNewControl . #xA9BE)
  174.                 (_HideControl . #xA958)
  175.                 (_HiliteControl . #xA95D)
  176.                 (_KillControls . #xA956)
  177.                 (_MoveControl . #xA959)
  178.                 (_NewControl . #xA954)
  179.                 (_SetCRefCon . #xA95B)
  180.                 (_SetCTitle . #xA95F)
  181.                 (_SetCtlAction . #xA96B)
  182.                 (_SetCtlValue . #xA963)
  183.                 (_SetMaxCtl . #xA965)
  184.                 (_SetMinCtl . #xA964)
  185.                 (_ShowControl . #xA957)
  186.                 (_SizeControl . #xA95C)
  187.                 (_TestControl . #xA966)
  188.                 (_TrackControl . #xA968)
  189.  
  190.                 (_UpdtControls . #xA953)
  191.  
  192.                 ;**************************************************
  193.                 ;Desk Accessory traps:
  194.  
  195.                 (_CloseDeskAcc . #xA9B7)
  196.                 (_OpenDeskAcc . #xA9B6)
  197.                 (_SysEdit . #xA9C2)
  198.                 (_SystemClick . #xA9B3)
  199.                 (_SystemEvent . #xA9B2)
  200.                 (_SystemMenu . #xA9B5)
  201.                 (_SystemTask . #xA9B4)
  202.  
  203.  
  204.                 ;**************************************************
  205.                 ;Dialog Manager traps:
  206.  
  207.                 (_Alert . #xA985)
  208.                 (_CautionAlert . #xA988)
  209.                 (_CloseDialog . #xA982)
  210.                 (_CouldAlert . #xA989)
  211.                 (_CouldDialog . #xA979)
  212.                 (_DialogSelect . #xA980)
  213.                 (_DisposDialog . #xA983)
  214.                 (_DrawDialog . #xA981)
  215.                 (_ErrorSound . #xA98C)
  216.                 (_FreeAlert . #xA98A)
  217.                 (_FreeDialog . #xA97A)
  218.                 (_GetDItem . #xA98D)
  219.                 (_GetIText . #xA990)
  220.                 (_GetNewDialog . #xA97C)
  221.                 (_InitDialogs . #xA97B)
  222.                 (_IsDialogEvent . #xA97F)
  223.                 (_ModalDialog . #xA991)
  224.                 (_NewDialog . #xA97D)
  225.                 (_NoteAlert . #xA987)
  226.                 (_ParamText . #xA98B)
  227.                 (_SelIText . #xA97E)
  228.                 (_SetDItem . #xA98E)
  229.                 (_SetIText . #xA98F)
  230.                 (_StopAlert . #xA986)
  231.  
  232.                 (_FindDItem . #xA984)
  233.                 (_HideDItem . #xA827)
  234.                 (_ShowDItem . #xA828)
  235.                 (_UpdtDialog . #xA978)
  236.  
  237.                 ;**************************************************
  238.                 ;Event Manager traps:
  239.  
  240.                 (_Button . #xA974)
  241.                 (_EventAvail . #xA971)
  242.                 (_GetKeys . #xA976)
  243.                 (_GetMouse . #xA972)
  244.                 (_GetNextEvent . #xA970)
  245.                 (_StillDown . #xA973)
  246.                 (_TickCount . #xA975)
  247.                 (_WaitMouseUp . #xA977)
  248.  
  249.                 ;**************************************************
  250.                 ;Font Manager traps:
  251.  
  252.                 (_FMSwapFont . #xA901)
  253.                 (_GetFName . #xA8FF)
  254.                 (_GetFNum . #xA900)
  255.                 (_InitFonts . #xA8FE)
  256.                 (_RealFont . #xA902)
  257.                 (_SetFontLock . #xA903)
  258.  
  259.                 (_FontMetrics . #xA835)
  260.                 (_SetFScaleDisable . #xA834)
  261.  
  262.                 ;**************************************************
  263.                 ;Menu Manager traps:
  264.  
  265.                 (_AddResMenu . #xA94D)
  266.                 (_AppendMenu . #xA933)
  267.                 (_CalcMenuSize . #xA948)
  268.                 (_CheckItem . #xA945)
  269.                 (_ClearMenuBar . #xA934)
  270.                 (_CountMItems . #xA950)
  271.                 (_DeleteMenu . #xA936)
  272.                 (_DisableItem . #xA93A)
  273.                 (_DisposMenu . #xA932)
  274.                 (_DrawMenuBar . #xA937)
  275.                 (_EnableItem . #xA939)
  276.                 (_FlashMenuBar . #xA94C)
  277.                 (_GetItem . #xA946)
  278.                 (_GetItmIcon . #xA93F)
  279.                 (_GetItmMark . #xA943)
  280.                 (_GetItmStyle . #xA941)
  281.                 (_GetMenuBar . #xA93B)
  282.                 (_GetMHandle . #xA949)
  283.                 (_GetNewMBar . #xA9C0)
  284.                 (_GetRMenu . #xA9BF)
  285.                 (_HiliteMenu . #xA938)
  286.                 (_InitMenus . #xA930)
  287.                 (_InsertMenu . #xA935)
  288.                 (_InsertResMenu . #xA951)
  289.                 (_MenuKey . #xA93E)
  290.                 (_MenuSelect . #xA93D)
  291.                 (_NewMenu . #xA931)
  292.                 (_SetItem . #xA947)
  293.                 (_SetItmIcon . #xA940)
  294.                 (_SetItmMark . #xA944)
  295.                 (_SetItmStyle . #xA942)
  296.                 (_SetMenuBar . #xA93C)
  297.                 (_SetMFlash . #xA94A)
  298.                 (_DelMenuItem . #xA952)
  299.                 (_InsMenuItem . #xA826)
  300.  
  301.  
  302.                 ;**************************************************
  303.                 ;Package Manager traps:
  304.  
  305.                 (_InitAllPacks . #xA9E6)
  306.                 (_InitPack . #xA9E5)
  307.                 (_Pack0 . #xA9E7)
  308.                 (_Pack1 . #xA9E8)
  309.                 (_Pack2 . #xA9E9)
  310.                 (_dskInit . #xA9E9)  ;Non-standard name
  311.                 (_Pack3 . #xA9EA)
  312.                 (_STDFile . #xA9EA)  ;Non-standard name
  313.                 (_Pack4 . #xA9EB)
  314.                 (_fp68k . #xA9EB)
  315.                 (_Pack5 . #xA9EC)
  316.                 (_elems68k . #xA9EC)
  317.                 (_Pack6 . #xA9ED)
  318.                 (_intUtil . #xA9ED) ;Non-standard name
  319.                 (_Pack7 . #xA9EE)
  320.                 (_DecStr68K . #xA9EE)
  321.                 (_Pack8 . #xA816)
  322.                 (_Pack9 . #xA82B)
  323.                 (_Pack10 . #xA82C)
  324.                 (_Pack11 . #xA82D)
  325.                 (_Pack12 . #xA82E)
  326.                 (_Pack13 . #xA82F)
  327.                 (_Pack14 . #xA830)
  328.                 (_Pack15 . #xA831)
  329.  
  330.                 ;**************************************************
  331.                 ;QuickDraw traps:
  332.  
  333.                 (_AddPt . #xA87E)
  334.                 (_ANGLEFROMSLOPE . #xA8C4)
  335.                 (_BackColor . #xA863)
  336.                 (_BackPat . #xA87C)
  337.                 (_CharWidth . #xA88D)
  338.                 (_ClipRect . #xA87B)
  339.                 (_ClosePgon . #xA8CC)
  340.                 (_ClosePicture . #xA8F4)
  341.                 (_ClosePort . #xA87D)
  342.                 (_CloseRgn . #xA8DB)
  343.                 (_ColorBit . #xA864)
  344.                 (_CopyBits . #xA8EC)
  345.                 (_CopyRgn . #xA8DC)
  346.                 (_DiffRgn . #xA8E6)
  347.                 (_DisposRgn . #xA8D9)
  348.                 (_DrawChar . #xA883)
  349.                 (_DrawPicture . #xA8F6)
  350.                 (_DrawString . #xA884)
  351.                 (_DrawText . #xA885)
  352.                 (_EmptyRect . #xA8AE)
  353.                 (_EmptyRgn . #xA8E2)
  354.                 (_EqualPt . #xA881)
  355.                 (_EqualRect . #xA8A6)
  356.                 (_EqualRgn . #xA8E3)
  357.                 (_EraseArc . #xA8C0)
  358.                 (_EraseOval . #xA8B9)
  359.                 (_ErasePoly . #xA8C8)
  360.                 (_EraseRect . #xA8A3)
  361.                 (_EraseRgn . #xA8D4)
  362.                 (_EraseRoundRect . #xA8B2)
  363.                 (_FillArc . #xA8C2)
  364.                 (_FillOval . #xA8BB)
  365.                 (_FillPoly . #xA8CA)
  366.                 (_FillRect . #xA8A5)
  367.                 (_FillRgn . #xA8D6)
  368.                 (_FillRoundRect . #xA8B4)
  369.                 (_ForeColor . #xA862)
  370.                 (_FrameArc . #xA8BE)
  371.                 (_FrameOval . #xA8B7)
  372.                 (_FramePoly . #xA8C6)
  373.                 (_FrameRect . #xA8A1)
  374.                 (_FrameRgn . #xA8D2)
  375.                 (_FrameRoundRect . #xA8B0)
  376.                 (_GetClip . #xA87A)
  377.                 (_GetFontInfo . #xA88B)
  378.                 (_GetPen . #xA89A)
  379.                 (_GetPenState . #xA898)
  380.                 (_GetPixel . #xA865)
  381.                 (_GetPort . #xA874)
  382.                 (_GlobalToLocal . #xA871)
  383.                 (_GrafDevice . #xA872)
  384.                 (_HideCursor . #xA852)
  385.                 (_HidePen . #xA896)
  386.                 (_InitCursor . #xA850)
  387.                 (_InitGraf . #xA86E)
  388.                 (_InitPort . #xA86D)
  389.                 (_InsetRect . #xA8A9)
  390.                 (_InsetRgn . #xA8E1)
  391.                 (_InverRect . #xA8A4)
  392.                 (_InverRgn . #xA8D5)
  393.                 (_InverRoundRect . #xA8B3)
  394.                 (_InvertArc . #xA8C1)
  395.                 (_InvertOval . #xA8BA)
  396.                 (_InvertPoly . #xA8C9)
  397.                 (_KillPicture . #xA8F5)
  398.                 (_KillPoly . #xA8CD)
  399.                 (_Line . #xA892)
  400.                 (_LineTo . #xA891)
  401.                 (_LocalToGlobal . #xA870)
  402.                 (_MapPoly . #xA8FC)
  403.                 (_MapPt . #xA8F9)
  404.                 (_MapRect . #xA8FA)
  405.                 (_MapRgn . #xA8FB)
  406.                 (_MOOV . #xA894) 
  407.                 (_Move . #xA894)
  408.                 (_MovePortTo . #xA877)
  409.                 (_MoveTo . #xA893)
  410.                 (_NewRgn . #xA8D8)
  411.                 (_ObscureCursor . #xA856)
  412.                 (_OffsetPoly . #xA8CE)
  413.                 (_OffsetRect . #xA8A8)
  414.                 (_OFSETRGN . #xA8E0) 
  415.                 (_OffsetRgn . #xA8E0)
  416.                 (_OpenPicture . #xA8F3)
  417.                 (_OpenPoly . #xA8CB)
  418.                 (_OpenPort . #xA86F)
  419.                 (_OpenRgn . #xA8DA)
  420.                 (_PackBits . #xA8CF)
  421.                 (_PaintArc . #xA8BF)
  422.                 (_PaintOval . #xA8B8)
  423.                 (_PaintPoly . #xA8C7)
  424.                 (_PaintRect . #xA8A2)
  425.                 (_PaintRgn . #xA8D3)
  426.                 (_PaintRoundRect . #xA8B1)
  427.                 (_PenMode . #xA89C)
  428.                 (_PenNormal . #xA89E)
  429.                 (_PenPat . #xA89D)
  430.                 (_PenSize . #xA89B)
  431.                 (_PicComment . #xA8F2)
  432.                 (_PortSize . #xA876)
  433.                 (_Pt2Rect . #xA8AC)
  434.                 (_PtInRect . #xA8AD)
  435.                 (_PtInRgn . #xA8E8)
  436.                 (_PtToAngle . #xA8C3)
  437.                 (_Random . #xA861)
  438.                 (_RectInRgn . #xA8E9)
  439.                 (_RectRgn . #xA8DF)
  440.                 (_ScalePt . #xA8F8)
  441.                 (_ScrollRect . #xA8EF)
  442.                 (_SectRect . #xA8AA)
  443.                 (_SectRgn . #xA8E4)
  444.                 (_SetClip . #xA879)
  445.                 (_SetCursor . #xA851)
  446.                 (_SetEmptyRgn . #xA8DD)
  447.                 (_SetOrigin . #xA878)
  448.                 (_SetPBits . #xA875)
  449.                 (_SetPenState . #xA899)
  450.                 (_SetPort . #xA873)
  451.                 (_SetPt . #xA880)
  452.                 (_SetRecRgn . #xA8DE)
  453.                 (_SetRect . #xA8A7)
  454.                 (_SetStdProcs . #xA8EA)
  455.                 (_ShowCursor . #xA853)
  456.                 (_ShowPen . #xA897)
  457.                 (_SLOPEFROMANGLE . #xA8BC)
  458.                 (_SpaceExtra . #xA88E)
  459.                 (_StdArc . #xA8BD)
  460.                 (_StdBits . #xA8EB)
  461.                 (_StdComment . #xA8F1)
  462.                 (_StdGetPic . #xA8EE)
  463.                 (_StdLine . #xA890)
  464.                 (_StdOval . #xA8B6)
  465.                 (_StdPoly . #xA8C5)
  466.                 (_StdPutPic . #xA8F0)
  467.                 (_StdRect . #xA8A0)
  468.                 (_StdRgn . #xA8D1)
  469.                 (_StdRRect . #xA8AF)
  470.                 (_StdText . #xA882)
  471.                 (_StdTxMeas . #xA8ED)
  472.                 (_StringWidth . #xA88C)
  473.                 (_StuffHex . #xA866)
  474.                 (_SubPt . #xA87F)
  475.                 (_TextFace . #xA888)
  476.                 (_TextFont . #xA887)
  477.                 (_TextMode . #xA889)
  478.                 (_TextSize . #xA88A)
  479.                 (_TextWidth . #xA886)
  480.                 (_UnionRect . #xA8AB)
  481.                 (_UnionRgn . #xA8E5)
  482.                 (_UnpackBits . #xA8D0)
  483.                 (_XOrRgn . #xA8E7)
  484.                 (_CalcMask . #xA838)
  485.                 (_CopyMask . #xA817)
  486.                 (_GetMaskTable . #xA836)
  487.                 (_MeasureText . #xA837)
  488.                 (_SeedFill . #xA839)
  489.  
  490.                 ;**************************************************
  491.                 ;Color traps:
  492.                 
  493.                 (_OPENCPORT . #xAA00) 
  494.                 (_INITCPORT . #xAA01) 
  495.                 (_CLOSECPORT . #xA87D) 
  496.                 (_NEWPIXMAP . #xAA03) 
  497.                 (_DISPOSPIXMAP . #xAA04) 
  498.                 (_COPYPIXMAP . #xAA05) 
  499.                 (_SETCPORTPIX . #xAA06) 
  500.                 (_NEWPIXPAT . #xAA07) 
  501.                 (_DISPOSPIXPAT . #xAA08) 
  502.                 (_COPYPIXPAT . #xAA09) 
  503.                 (_PENPIXPAT . #xAA0A) 
  504.                 (_BACKPIXPAT . #xAA0B) 
  505.                 (_GETPIXPAT . #xAA0C) 
  506.                 (_MAKERGBPAT . #xAA0D) 
  507.                 (_FILLCRECT . #xAA0E) 
  508.                 (_FILLCOVAL . #xAA0F) 
  509.                 (_FILLCROUNDRECT . #xAA10) 
  510.                 (_FILLCARC . #xAA11) 
  511.                 (_FILLCRGN . #xAA12) 
  512.                 (_FILLCPOLY . #xAA13) 
  513.                 (_RGBFORECOLOR . #xAA14) 
  514.                 (_RGBBACKCOLOR . #xAA15) 
  515.                 (_SETCPIXEL . #xAA16) 
  516.                 (_GETCPIXEL . #xAA17) 
  517.                 (_GETCTABLE . #xAA18) 
  518.                 (_GETFORECOLOR . #xAA19) 
  519.                 (_GETBACKCOLOR . #xAA1A) 
  520.                 (_GETCCURSOR . #xAA1B) 
  521.                 (_SETCCURSOR . #xAA1C) 
  522.                 (_ALLOCCURSOR . #xAA1D) 
  523.                 (_GETCICON . #xAA1E) 
  524.                 (_PLOTCICON . #xAA1F) 
  525.                 (_OPCOLOR . #xAA21) 
  526.                 (_HILITECOLOR . #xAA22) 
  527.                 (_CHAREXTRA . #xAA23) 
  528.                 (_DISPOSCTABLE . #xAA24) 
  529.                 (_DISPOSCICON . #xAA25) 
  530.                 (_DISPOSCCURSOR . #xAA26) 
  531.                 (_SEEDCFILL . #xAA50) 
  532.                 (_CALCCMASK . #xAA4F) 
  533.                 (_GETMAXDEVICE . #xAA27) 
  534.                 (_GETCTSEED . #xAA28) 
  535.                 (_GETDEVICELIST . #xAA29) 
  536.                 (_GETMAINDEVICE . #xAA2A) 
  537.                 (_GETNEXTDEVICE . #xAA2B) 
  538.                 (_TESTDEVICEATTRIBUTE . #xAA2C) 
  539.                 (_SETDEVICEATTRIBUTE . #xAA2D) 
  540.                 (_INITGDEVICE . #xAA2E) 
  541.                 (_NEWGDEVICE . #xAA2F) 
  542.                 (_DISPOSGDEVICE . #xAA30) 
  543.                 (_SETGDEVICE . #xAA31) 
  544.                 (_GETGDEVICE . #xAA32) 
  545.                 (_COLOR2INDEX . #xAA33) 
  546.                 (_INDEX2COLOR . #xAA34) 
  547.                 (_INVERTCOLOR . #xAA35) 
  548.                 (_REALCOLOR . #xAA36) 
  549.                 (_GETSUBTABLE . #xAA37) 
  550.                 (_MAKEITABLE . #xAA39) 
  551.                 (_ADDSEARCH . #xAA3A) 
  552.                 (_ADDCOMP . #xAA3B) 
  553.                 (_SETCLIENTID . #xAA3C) 
  554.                 (_PROTECTENTRY . #xAA3D) 
  555.                 (_RESERVEENTRY . #xAA3E) 
  556.                 (_SETENTRIES . #xAA3F) 
  557.                 (_QDERROR . #xAA40) 
  558.                 (_SAVEENTRIES . #xAA49) 
  559.                 (_RESTOREENTRIES . #xAA4A) 
  560.                 (_DELSEARCH . #xAA4C) 
  561.                 (_DELCOMP . #xAA4D) 
  562.                 (_SETSTDCPROCS . #xAA4E) 
  563.                 (_STDOPCODEPROC . #xABF8) 
  564.                 (_SETWINCOLOR . #xAA41) 
  565.                 (_GETAUXWIN . #xAA42) 
  566.                 (_SETCTLCOLOR . #xAA43) 
  567.                 (_GETAUXCTL . #xAA44) 
  568.                 (_NEWCWINDOW . #xAA45) 
  569.                 (_GETNEWCWINDOW . #xAA46) 
  570.                 (_SETDESKCPAT . #xAA47) 
  571.                 (_GETCWMGRPORT . #xAA48) 
  572.                 (_GETCVARIANT . #xA809) 
  573.                 (_GETWVARIANT . #xA80A) 
  574.                 (_DELMCENTRIES . #xAA60) 
  575.                 (_GETMCINFO . #xAA61) 
  576.                 (_SETMCINFO . #xAA62) 
  577.                 (_DISPMCINFO . #xAA63) 
  578.                 (_GETMCENTRY . #xAA64) 
  579.                 (_SETMCENTRIES . #xAA65) 
  580.                 (_MENUCHOICE . #xAA66) 
  581.                 (_SETFRACTENABLE . #xA814) 
  582.                 (_NEWCDIALOG . #xAA4B)
  583.  
  584.                 ;**************************************************
  585.                 ;Resource Manager traps:
  586.  
  587.                 ;_AddReference    trapw    #xA9AC    removed in Mac+
  588.                 (_AddResource . #xA9AB)
  589.                 (_ChangedResData . #xA9AA)
  590.                 (_CloseResFile . #xA99A)
  591.                 (_CountResources . #xA99C)
  592.                 (_CountTypes . #xA99E)
  593.                 (_CreateResFile . #xA9B1)
  594.                 (_CurResFile . #xA994)
  595.                 (_DetachResource . #xA992)
  596.                 (_GetIndResource . #xA99D)
  597.                 (_GetIndType . #xA99F)
  598.                 (_GetNamedResource . #xA9A1)
  599.                 (_GetResAttrs . #xA9A6)
  600.                 (_GetResFileAttrs . #xA9F6)
  601.                 (_GetResInfo . #xA9A8)
  602.                 (_GetResource . #xA9A0)
  603.                 (_HomeResFile . #xA9A4)
  604.                 (_InitResource . #xA995)
  605.                 (_LoadResource . #xA9A2)
  606.                 (_OpenResFile . #xA997)
  607.                 (_ReleaseResource . #xA9A3)
  608.                 (_ResError . #xA9AF)
  609.                 ;_RmveReference    trapw    #xA9AE    removed in Mac+
  610.                 (_RmveResource . #xA9AD)
  611.                 (_RsrcZoneInit . #xA996)
  612.                 (_SetResAttrs . #xA9A7)
  613.                 (_SetResFileAttrs . #xA9F7)
  614.                 (_SetResInfo . #xA9A9)
  615.                 (_SetResLoad . #xA99B)
  616.                 (_SetResPurge . #xA993)
  617.                 (_SizeResource . #xA9A5)
  618.                 (_UniqueID . #xA9C1)
  619.                 (_UpdateResFile . #xA999)
  620.                 (_UseResFile . #xA998)
  621.                 (_WriteResource . #xA9B0)
  622.                 (_Count1Resources . #xA80D)
  623.                 (_Count1Types . #xA81C)
  624.                 (_Get1IndResource . #xA80E)
  625.                 (_Get1IndType . #xA80F)
  626.                 (_GET1IXRESOURCE . #xA80E) 
  627.                 (_GET1IXTYPE . #xA80F)
  628.                 (_Get1NamedResource . #xA820)
  629.                 (_Get1Resource . #xA81F)
  630.                 (_MaxSizeRsrc . #xA821)
  631.                 (_OpenRFPerm . #xA9C4)
  632.                 (_RsrcMapEntry . #xA9C5)
  633.                 (_Unique1ID . #xA810)
  634.                 (_XMUNGER . #xA819) 
  635.  
  636.                 ;**************************************************
  637.                 ;Scrap Manager traps:
  638.  
  639.                 (_GetScrap . #xA9FD)
  640.                 (_InfoScrap . #xA9F9)
  641.                 (_LodeScrap . #xA9FB)
  642.                 (_PutScrap . #xA9FE)
  643.                 (_UnlodeScrap . #xA9FA)
  644.                 (_ZeroScrap . #xA9FC)
  645.  
  646.                 ;**************************************************
  647.                 ;Segment Loader traps:
  648.  
  649.                 (_ExitToShell . #xA9F4)
  650.                 (_GetAppParms . #xA9F5)
  651.                 (_LoadSeg . #xA9F0)
  652.                 (_UnloadSeg . #xA9F1)
  653.  
  654.                 ;**************************************************
  655.                 ;Text Edit traps:
  656.  
  657.                 (_TEActivate . #xA9D8)
  658.                 (_TECalText . #xA9D0)
  659.                 (_TEClick . #xA9D4)
  660.                 (_TECopy . #xA9D5)
  661.                 (_TECut . #xA9D6)
  662.                 (_TEDeactivate . #xA9D9)
  663.                 (_TEDelete . #xA9D7)
  664.                 (_TEDispose . #xA9CD)
  665.                 (_TEGetText . #xA9CB)
  666.                 (_TEIdle . #xA9DA)
  667.                 (_TEInit . #xA9CC)
  668.                 (_TEInsert . #xA9DE)
  669.                 (_TEKey . #xA9DC)
  670.                 (_TENew . #xA9D2)
  671.                 (_TEPaste . #xA9DB)
  672.                 (_TEScroll . #xA9DD)
  673.                 (_TESetJust . #xA9DF)
  674.                 (_TESetSelect . #xA9D1)
  675.                 (_TESetText . #xA9CF)
  676.                 (_TEUpdate . #xA9D3)
  677.                 (_TextBox . #xA9CE)
  678.                 (_TEAutoView . #xA813)
  679.                 (_TEPinScroll . #xA812)
  680.                 (_TESelView . #xA811)
  681.  
  682.                 ;**************************************************
  683.                 ;Toolbox Utilities traps:
  684.  
  685.                 (_BitAnd . #xA858)
  686.                 (_BitClr . #xA85F)
  687.                 (_BitNot . #xA85A)
  688.                 (_BitOr . #xA85B)
  689.                 (_BitSet . #xA85E)
  690.                 (_BitShift . #xA85C)
  691.                 (_BitTst . #xA85D)
  692.                 (_BitXOr . #xA859)
  693.                 (_FixMul . #xA868)
  694.                 (_FixRatio . #xA869)
  695.                 (_FixRound . #xA86C)
  696.                 (_GetCursor . #xA9B9)
  697.                 (_GetIcon . #xA9BB)
  698.                 (_GetPattern . #xA9B8)
  699.                 (_GetPicture . #xA9BC)
  700.                 (_GetString . #xA9BA)
  701.                 (_HiWord . #xA86A)
  702.                 (_LongMul . #xA867)
  703.                 (_LoWord . #xA86B)
  704.                 (_Munger . #xA9E0)
  705.                 (_NewString . #xA906)
  706.                 (_PlotIcon . #xA94B)
  707.                 (_SetString . #xA907)
  708.                 (_ShieldCursor . #xA855)
  709.                 (_FixAtan2 . #xA818)
  710.                 (_FixDiv . #xA84D)
  711.                 (_Fix2Frac . #xA841)
  712.                 (_Fix2Long . #xA840)
  713.                 (_Fix2X . #xA843)
  714.                 (_FracCos . #xA847)
  715.                 (_FracDiv . #xA84B)
  716.                 (_FracMul . #xA84A)
  717.                 (_FracSin . #xA848)
  718.                 (_FracSqrt . #xA849)
  719.                 (_Frac2Fix . #xA842)
  720.                 (_Frac2X . #xA845)
  721.                 (_Long2Fix . #xA83F)
  722.                 (_X2Fix . #xA844)
  723.                 (_X2Frac . #xA846)
  724.  
  725.                 ;**************************************************
  726.                 ;Window Manager traps:
  727.  
  728.                 (_BeginUpdate . #xA922)
  729.                 (_BringToFront . #xA920)
  730.                 (_CalcVBehind . #xA90A)
  731.                 (_CalcVis . #xA909)
  732.                 (_CheckUpdate . #xA911)
  733.                 (_ClipAbove . #xA90B)
  734.                 (_CloseWindow . #xA92D)
  735.                 (_DisposWindow . #xA914)
  736.                 (_DragGrayRgn . #xA905)
  737.                 (_DragTheRgn . #xA926)
  738.                 (_DragWindow . #xA925)
  739.                 (_DrawGrowIcon . #xA904)
  740.                 (_DrawNew . #xA90F)
  741.                 (_EndUpdate . #xA923)
  742.                 (_FindWindow . #xA92C)
  743.                 (_FrontWindow . #xA924)
  744.                 (_GetNewWindow . #xA9BD)
  745.                 (_GetWindowPic . #xA92F)
  746.                 (_GetWMgrPort . #xA910)
  747.                 (_GetWRefCon . #xA917)
  748.                 (_GetWTitle . #xA919)
  749.                 (_GrowWindow . #xA92B)
  750.                 (_HideWindow . #xA916)
  751.                 (_HiliteWindow . #xA91C)
  752.                 (_InitWindows . #xA912)
  753.                 (_InvalRect . #xA928)
  754.                 (_InvalRgn . #xA927)
  755.                 (_MoveWindow . #xA91B)
  756.                 (_NewWindow . #xA913)
  757.                 (_PaintBehind . #xA90D)
  758.                 (_PaintOne . #xA90C)
  759.                 (_PinRect . #xA94E)
  760.                 (_SaveOld . #xA90E)
  761.                 (_SelectWindow . #xA91F)
  762.                 (_SendBehind . #xA921)
  763.                 (_SetWindowPic . #xA92E)
  764.                 (_SetWRefCon . #xA918)
  765.                 (_SetWTitle . #xA91A)
  766.                 (_ShowHide . #xA908)
  767.                 (_ShowWindow . #xA915)
  768.                 (_SizeWindow . #xA91D)
  769.                 (_TrackGoAway . #xA91E)
  770.                 (_ValidRect . #xA92A)
  771.                 (_ValidRgn . #xA929)
  772.                 (_TrackBox . #xA83B)
  773.                 (_ZoomWindow . #xA83A)
  774.  
  775.                 ;**************************************************
  776.                 ;Misc. traps:
  777.  
  778.                 (_SCSIDispatch . #xA815)
  779.                 (_SysBeep . #xA9C8)
  780.                 ;the below added by cfry 10/22/87
  781.                 (_SCRNBITMAP . #xA833) 
  782.                 (_DELTAPOINT . #xA94F) 
  783.                 (_UPDTCONTROL . #xA953) 
  784.                 (_INITRESOURCES . #xA995) 
  785.                 (_SIZERSRC . #xA9A5) 
  786.                 (_CHANGEDRESOURCE . #xA9AA) 
  787.                 (_ADDREFERENCE . #xA9AC) 
  788.                 (_RMVEREFERENCE . #xA9AE) 
  789.                 (_METHODDISPATCH . #xA9F8) 
  790.                 (_DEBUGGER . #xA9FF)
  791.                 (_RGETRESOURCE . #xA80C) 
  792.                 (_INITPROCMENU . #xA808) 
  793.                 (_GETITEMCMD . #xA84E) 
  794.                 (_SETITEMCMD . #xA84F) 
  795.                 (_POPUPMENUSELECT . #xA80B) 
  796.                 (_KEYTRANS . #xA9C3) 
  797.                 (_TEGETOFFSET . #xA83C) 
  798.                 (_TEDISPATCH . #xA83D) 
  799.                 (_TESTYLENEW . #xA83E) 
  800.  
  801.                )))
  802.   (dotimes (i (length traps))
  803.     (let ((data (svref traps i)))
  804.       (export (car data))
  805.       (define-constant (car data) (cdr data))
  806.       (%macro-have (car data) macro-fn))))
  807.  
  808. ;; ####################################################################
  809. ;; ######################## Register Traps ############################
  810. ;; ####################################################################
  811. (let ((macro-fn #'register-trap-macro-function)
  812.       (traps '#(
  813.                 ;**************************************************
  814.                 ;Event Manager traps:
  815.                 (_FlushEvents . #xA032)
  816.                 (_PostEvent . #xA02F)
  817.  
  818.                 ;**************************************************
  819.                 ;Device Manager traps:
  820.  
  821.                 (_Control . #xA004)
  822.                 (_KillIO . #xA006)
  823.                 (_Status . #xA005)
  824.  
  825.                 ;**************************************************
  826.                 ;File Manager traps:
  827.  
  828.                 (_AddDrive . #xA04E)
  829.                 (_Allocate . #xA010)
  830.                 (_AllocContig . #xA210)
  831.                 (_Close . #xA001)
  832.                 (_Create . #xA008)
  833.                 (_Delete . #xA009)
  834.                 (_Eject . #xA017)
  835.                 (_FINITQUEUE . #xA016) 
  836.                 (_FlushFile . #xA045)
  837.                 (_FlushVol . #xA013)
  838.                 (_GetEOF . #xA011)
  839.                 (_GetFileInfo . #xA00C)
  840.                 (_GetFPos . #xA018)
  841.                 (_GetVol . #xA014)
  842.                 (_GetVolInfo . #xA007)
  843.                 (_HCreate . #xA208)
  844.                 (_HDelete . #xA209)
  845.                 (_HGetFileInfo . #xA20C)
  846.                 (_HGetVInfo . #xA207)
  847.                 (_HGetVol . #xA214)
  848.                 (_HOpen . #xA200)
  849.                 (_HOpenRF . #xA20A)
  850.                 (_HRename . #xA20B)
  851.                 (_HRstFLock . #xA242)
  852.                 (_HSetFileInfo . #xA20D)
  853.                 (_HSetFLock . #xA241)
  854.                 (_HSetVol . #xA215)
  855.                 (_InitQueue . #xA016)
  856.                 (_MountVol . #xA00F)
  857.                 (_Offline . #xA035)
  858.                 (_Open . #xA000)
  859.                 (_OpenRF . #xA00A)
  860.                 (_Read . #xA002)
  861.                 (_Rename . #xA00B)
  862.                 (_RstFilLock . #xA042)
  863.                 (_SetEOF . #xA012)
  864.                 (_SetFileInfo . #xA00D)
  865.                 (_SetFilLock . #xA041)
  866.                 (_SetFilType . #xA043)
  867.                 (_SetFPos . #xA044)
  868.                 (_SetPEOF . #xA212)
  869.                 (_SetVol . #xA015)
  870.                 (_UnmountVol . #xA00E)
  871.                 (_Write . #xA003)
  872.                 (_HFSDispatch . #xA260)
  873.  
  874.                 ;**************************************************
  875.                 ;Memory Manager traps:
  876.  
  877.                 (_BlockMove . #xA02E)
  878.                 (_CompactMem . #xA14C)
  879.                 (_DisposHandle . #xA023)
  880.                 (_DisposPtr . #xA01F)
  881.                 (_EmptyHandle . #xA02B)
  882.                 (_FreeMem . #xA01C)
  883.                 (_GetHandleSize . #xA025)
  884.                 (_GetPtrSize . #xA021)
  885.                 (_GetZone . #xA11A)
  886.                 (_HandleZone . #xA126)
  887.                 (_HLock . #xA029)
  888.                 (_HNoPurge . #xA04A)
  889.                 (_HPurge . #xA049)
  890.                 (_HUnlock . #xA02A)
  891.                 (_InitApplZone . #xA02C)
  892.                 (_InitZone . #xA019)
  893.                 (_MaxMem . #xA11D)
  894.                 (_MoreMasters . #xA036)
  895.                 (_NewHandle . #xA122)
  896.                 (_NewPtr . #xA11E)
  897.                 (_PtrZone . #xA148)
  898.                 (_PurgeMem . #xA14D)
  899.                 (_ReallocHandle . #xA027)
  900.                 (_RecoverHandle . #xA128)
  901.                 (_ReservMem . #xA140)
  902.                 (_SetAppBase . #xA857)
  903.                 (_SetApplLimit . #xA02D)
  904.                 (_SetGrowZone . #xA04B)
  905.                 (_SetHandleSize . #xA024)
  906.                 (_SetPtrSize . #xA020)
  907.                 (_SetZone . #xA01B)
  908.                 (_HClrRBit . #xA068)
  909.                 (_HGetState . #xA069)
  910.                 (_HSetRBit . #xA067)
  911.                 (_HSetState . #xA06A)
  912.                 (_MaxApplZone . #xA063)
  913.                 (_MaxBlock . #xA061)
  914.                 (_MoveHHi . #xA064)
  915.                 (_NewEmptyHandle . #xA066)
  916.                 (_PurgeSpace . #xA062)
  917.                 (_StackSpace . #xA065)
  918.  
  919.                 ;**************************************************
  920.                 ;OS Event Manager traps:
  921.  
  922.                 (_GetOSEvent . #xA031)
  923.                 (_OSEventAvail . #xA030)
  924.  
  925.                 ;**************************************************
  926.                 ;OS Utilities traps:
  927.  
  928.                 (_CmpString . #xA03C)
  929.                 (_Date2Secs . #xA9C7)
  930.                 (_Delay . #xA03B)
  931.                 (_Dequeue . #xA96E)
  932.                 (_DrvrInstall . #xA03D)
  933.                 (_DrvrRemove . #xA03E)
  934.                 (_Enqueue . #xA96F)
  935.                 (_GetTrapAddress . #xA146)
  936.                 (_HandAndHand . #xA9E4)
  937.                 (_HandToHand . #xA9E1)
  938.                 (_InitUtil . #xA03F)
  939.                 (_PtrAndHand . #xA9EF)
  940.                 (_PtrToHand . #xA9E3)
  941.                 (_PtrToXHand . #xA9E2)
  942.                 (_RDrvrInstall . #xA04F)
  943.                 (_ReadParm . #xA037)
  944.                 (_PutIcon . #xA9CA)
  945.                 (_ReadDateTime . #xA039)
  946.                 (_Secs2Date . #xA9C6)
  947.                 (_SetDateTime . #xA03A)
  948.                 (_SetTrapAddress . #xA047)
  949.                 (_SysError . #xA9C9)
  950.                 (_UprString . #xA854)
  951.                 (_VInstall . #xA033)
  952.                 (_VRemove . #xA034)
  953.                 (_WriteParam . #xA038)
  954.                 (_Chain . #xA9F3)
  955.                 (_Launch . #xA9F2)
  956.                 (_RelString . #xA050)
  957.  
  958.                 ;**************************************************
  959.                 ;Miscellaneous new register traps:
  960.  
  961.                 (_PPOSTEVENT . #xA12F) 
  962.                 (_RESRVMEM . #xA040) 
  963.                 (_SETAPPLBASE . #xA057) 
  964.                 (_READXPRAM . #xA051) 
  965.                 (_WRITEXPRAM . #xA052) 
  966.                 (_INSTIME . #xA058) 
  967.                 (_RMVTIME . #xA059) 
  968.                 (_PRIMETIME . #xA05A) 
  969.                 (_INITFS . #xA06C) 
  970.                 (_INITEVENTS . #xA06D) 
  971.                 (_STRIPADDRESS . #xA055) 
  972.                 (_SWAPMMUMODE . #xA05D) 
  973.                 (_SLOTVINSTALL . #xA06F) 
  974.                 (_SLOTVREMOVE . #xA070) 
  975.                 (_ATTACHVBL . #xA071) 
  976.                 (_DOVBLTASK . #xA072) 
  977.                 (_SINTINSTALL . #xA075) 
  978.                 (_SINTREMOVE . #xA076) 
  979.                 (_COUNTADBS . #xA077) 
  980.                 (_GETINDADB . #xA078) 
  981.                 (_GETADBINFO . #xA079) 
  982.                 (_SETADBINFO . #xA07A) 
  983.                 (_ADBREINIT . #xA07B) 
  984.                 (_ADBOP . #xA07C) 
  985.                 (_GETDEFAULTSTARTUP . #xA07D) 
  986.                 (_SETDEFAULTSTARTUP . #xA07E) 
  987.                 (_INTERNALWAIT . #xA07F)
  988.                 (_GETVIDEODEFAULT . #xA080) 
  989.                 (_SETVIDEODEFAULT . #xA081) 
  990.                 (_DTINSTALL . #xA082) 
  991.                 (_SETOSDEFAULT . #xA083) 
  992.                 (_GETOSDEFAULT . #xA084)
  993.  
  994.                )))
  995.   (dotimes (i (length traps))
  996.     (let ((data (svref traps i)))
  997.       (export (car data))
  998.       (define-constant (car data) (cdr data))
  999.       (%macro-have (car data) macro-fn))))
  1000.    ;end of REGISTER TRAPS
  1001.  
  1002.  
  1003. ;; ####################################################################
  1004. ;; ######################### Package Traps ############################
  1005. ;; ####################################################################
  1006. (let ((macro-fn #'pack-trap-macro-function)
  1007.       (traps '#(
  1008.                 (_DIBadMount 0 . _Pack2)
  1009.                 (_DILoad 2 . _Pack2)
  1010.                 (_DIUnload 4 . _Pack2)
  1011.                 (_DIFormat 6 . _Pack2)
  1012.                 (_DIVerify 8 . _Pack2)
  1013.                 (_DIZero 10 . _Pack2)
  1014.                 (_LActivate 0 . _Pack0)
  1015.                 (_LAddColumn 4 . _Pack0)
  1016.                 (_LAddRow 8 . _Pack0)
  1017.                 (_LAddToCell 12 . _Pack0)
  1018.                 (_LAutoScroll 16 . _Pack0)
  1019.                 (_LCellSize 20 . _Pack0)
  1020.                 (_LClick 24 . _Pack0)
  1021.                 (_LClrCell 28 . _Pack0)
  1022.                 (_LDelColumn 32 . _Pack0)
  1023.                 (_LDelRow 36 . _Pack0)
  1024.                 (_LDispose 40 . _Pack0)
  1025.                 (_LDoDraw 44 . _Pack0)
  1026.                 (_LDraw 48 . _Pack0)
  1027.                 (_LFind 52 . _Pack0)
  1028.                 (_LGetCell 56 . _Pack0)
  1029.                 (_LGetSelect 60 . _Pack0)
  1030.                 (_LLastClick 64 . _Pack0)
  1031.                 (_LNew 68 . _Pack0)
  1032.                 (_LNextCell 72 . _Pack0)
  1033.                 (_LRect 76 . _Pack0)
  1034.                 (_LScroll 80 . _Pack0)
  1035.                 (_LSearch 84 . _Pack0)
  1036.                 (_LSetCell 88 . _Pack0)
  1037.                 (_LSetSelect 92 . _Pack0)
  1038.                 (_LSize 96 . _Pack0)
  1039.                 (_LUpdate 100 . _Pack0)
  1040.  
  1041.                 (_SFPutFile 1 . _Pack3)
  1042.                 (_SFGetFile 2 . _Pack3)
  1043.                 (_SFPPutFile 3 . _Pack3)
  1044.                 (_SFPGetFile 4 . _Pack3)
  1045.  
  1046.                 (_iuDateString 0 . _Pack6)
  1047.                 (_iuTimeString 2 . _Pack6)
  1048.                 (_iuMetric 4 . _Pack6)
  1049.                 (_iuGetIntl 6 . _Pack6)
  1050.                 (_iuSetIntl 8 . _Pack6)
  1051.                 (_iuMagString 10 . _Pack6)
  1052.                 (_iuMagIDString 12 . _Pack6)
  1053.                 (_iuDatePString 14 . _Pack6)
  1054.                 (_iuTimePString 16 . _Pack6)
  1055.  
  1056.                 ;Unfortunately the args are in registers but package selector is on stack.
  1057.                 ;(_numtostring 0 . _Pack7)
  1058.                 ;(_stringtonum 1 . _Pack7)
  1059.                )))
  1060.   (dotimes (i (length traps))
  1061.     (let ((data (svref traps i)))
  1062.       (export (car data))
  1063.       (define-constant (car data) (cadr data))
  1064.       (put (car data) 'sys-trap-pack (cddr data))
  1065.       (%macro-have (car data) macro-fn))))
  1066.  
  1067. ;; ####################################################################
  1068. ;; ########################### HFS Traps ##############################
  1069. ;; ####################################################################
  1070. (let ((macro-fn #'hfs-trap-macro-function)
  1071.       (traps '#((_FSControl . 0)
  1072.                 (_OpenWD . 1)
  1073.                 (_CloseWD . 2)
  1074.                 (_CatMove . 5)
  1075.                 (_DirCreate . 6)
  1076.                 (_GetWDInfo . 7)
  1077.                 (_GetFCBInfo . 8)
  1078.                 (_GetCatInfo . 9)
  1079.                 (_SetCatInfo . 10)
  1080.                 (_SetVolInfo . 11)
  1081.                 (_SetPMSP . 12)
  1082.                 (_LockRng . 16)
  1083.                 (_UnlockRng . 17)
  1084.                )))
  1085.   (dotimes (i (length traps))
  1086.     (let ((data (svref traps i)))
  1087.       (export (car data))
  1088.       (define-constant (car data) (cdr data))
  1089.       (%macro-have (car data) macro-fn))))
  1090.  
  1091.  
  1092. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1093. ;;
  1094. ;;almost all done
  1095.  
  1096. (provide 'traps)
  1097. (pushnew :traps *features*)